<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css"
          integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
            integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
            crossorigin="anonymous"></script>
    <meta charset="UTF-8">
    <title>图书管理系统</title>
    <link rel="stylesheet" href={% static 'css/bookmanage.css' %}>
</head>
<body>

<div class="title">
    <h1 style="text-align: center">图书管理系统</h1>
</div>
<a href="{% url "bookinfocollect" %}">
    <button type="button" class="btn btn-success" style="margin-left: 20px;margin-top: 20px">添加书籍</button>
</a>

<form action="/bookai/querybook" style="margin-left: 20px;margin-top: 20px">
    <input type="text" name="keyword">
    <input type="submit" value="搜索">
</form>

<div class="row">
    <div class="col-md-5" style="border: antiquewhite 1px solid;padding: 10px 30px;margin: 10px;text-align: left">
        <h2 style="text-align: center;color: blueviolet">书籍列表</h2>
        {% for book in books %}
            <p style="font-size: 30px;display: inline">
                <input type="text" value="bookid:{{ book.id }}" hidden>
                <a href="{% url "showbook" book.id %}"><strong>{{ book.name }}</strong>
                </a>
            </p>


            {#    <a href="{% url "showbook" book.id %} ">bookid:{{ book.id }}---{{ book.name }}</a>#}
            <a href="{% url "delbook" book.id %}"> <em>删除</em> </a> &nbsp;
            <a href="{% url "updatebook" book.id %}"><strong>修改</strong></a>
            <br>
            <br>
        {% endfor %}
        <br>
        <br>

        <div style="text-align: center">
            {% if current_page_num > 1 %}
                <a href="/bookai/showbooks/?page={{ pre_page }}">上一页</a>
            {% endif %}
            &nbsp;<a href="">当前页:{{ current_page_num }}</a> &nbsp;
            {% if shownext %}
                <a href="{% url 'showbooks' %}?page={{ next_page }}">下一页</a>
            {% endif %}
        </div>

    </div>
    <div class="col-md-5" style="border: chartreuse 1px solid;padding: 10px;margin: 10px">
        <h2 style="text-align: center;color: blueviolet">最新书籍</h2>
    </div>
</div>


<br>
<div class="footer" align="center">
    如果有找不到的书籍请联系我,lcqbug@qq.com
</div>

</body>
</html>